(function($){
	$(function(){
		var resizePage = (function () {
            $("body").height($(window).height());
            var ww = $(window).width(),
                wh = $("body").innerHeight(),
                
                $menu = $(".menu"),
                $content = $(".content");

            $menu.height(wh);
            $content.height(wh);
            return arguments.callee;
        })();

        $(window).resize(resizePage);
        
		//全局定义一个左下角按钮鼠标hover时tip样式
        var bottomTipStyle = {
				my:"right+16 top+10",
				at:"right bottom",
				arrowStyle:{
					"left":"auto",
					"right":"24px"
			}}
		//点击左侧收缩导航菜单按钮操作
		$(".menu").on("click",".draw-icon",function(e){
			e.stopPropagation();
			if($(this).hasClass("on")){
				$(this).removeClass("on");
				$(".menu").animate({width: "160px"}, 200 );
				$(".content").animate({marginLeft: "160px"}, 200 );
				$(".bottom-menu").width("140px");
				$(".bottom-menu").find(".bottom-list").css({float : "left" , width: "33%"});
				$(".menu-list").unbind('mouseenter').unbind('mouseleave');
				
				leftBottom(bottomTipStyle);
			}else{
				$(this).addClass("on");
				$(".menu").animate({width: "62px"}, 200 );
				$(".content").animate({marginLeft: "62px"}, 200 );
				$(".bottom-menu").width("42px");
				$(".bottom-menu").find(".bottom-list").css({float : "none" , width: "100%"});
				$(".menu-list").animateTip({
					my:"left+10 middle",
					at:"right middle"
				});
				leftBottom({my:"left+24 middle",at:"right middle"});
			}
		})
		//点击导航按钮
		.on("click",".menu-list",function(e){
			e.stopPropagation();
			$(".menu-link").removeClass("active");
			$(this).find(".menu-link").addClass("active");
		})
		//左下角按钮鼠标hover时tip显示方法
		function leftBottom(obj){
			$(".bottom_icon").unbind('mouseenter').unbind('mouseleave');	
			$(".bottom_icon").animateTip(obj);
		}
		leftBottom(bottomTipStyle);
	})
})(jQuery);

//多个iframe之间数据传递
function setData(transData){
	var dataPanel = $('<div id="transData"></div>');
	$(dataPanel).attr("transData",JSON.stringify(transData)).appendTo($("body"));
};
function getData(){
	var data = $("#transData").attr("transData");
	$("#transData").remove();
	return JSON.parse(data);
}

